//
//  EvaluateStarCell.m
//  CenturyCity
//
//  Created by beisheng03 on 2018/1/8.
//  Copyright © 2018年 beisheng. All rights reserved.
//

#import "EvaluateStarCell.h"

@interface EvaluateStarCell ()
@property (weak, nonatomic) IBOutlet UIButton *bottomFirstBtn;
@property (weak, nonatomic) IBOutlet UIButton *bottomTwoBtn;
@property (weak, nonatomic) IBOutlet UIButton *bottomThreeBtn;
@property (weak, nonatomic) IBOutlet UIButton *bottomFourBtn;
@property (weak, nonatomic) IBOutlet UIButton *bottomFiveBtn;
@property (weak, nonatomic) IBOutlet UIButton *topFirstBtn;
@property (weak, nonatomic) IBOutlet UIButton *topTwoBtn;
@property (weak, nonatomic) IBOutlet UIButton *topThreeBtn;
@property (weak, nonatomic) IBOutlet UIButton *topFourBtn;
@property (weak, nonatomic) IBOutlet UIButton *topFiveBtn;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomMargin;

@property (weak, nonatomic) IBOutlet UILabel *leftLabel;

@end

@implementation EvaluateStarCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.topFirstBtn.hidden = YES;
    self.topTwoBtn.hidden = YES;
    self.topThreeBtn.hidden = YES;
    self.topFourBtn.hidden = YES;
    self.topFiveBtn.hidden = YES;
    
    self.topFirstBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
    self.topTwoBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
    self.topThreeBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
    self.topFourBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
    self.topFiveBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
    
    
    self.bottomFirstBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
    self.bottomTwoBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
    self.bottomThreeBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
    self.bottomFourBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
    self.bottomFiveBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;

    
    self.leftLabel.font = MYFONT(14);
    
    self.leftLabel.textColor = darkGray;
    
    self.bottomMargin.constant = 0;

    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (IBAction)bottomFirstBtnDidTap:(UIButton *)sender {
    
    self.topFirstBtn.hidden = NO;
    self.topTwoBtn.hidden = YES;
    self.topThreeBtn.hidden = YES;
    self.topFourBtn.hidden = YES;
    self.topFiveBtn.hidden = YES;
    
    self.model.scores = @"1";
    [self.viewController.view endEditing:YES];

}

- (IBAction)bottomTwoBtnDidTap:(UIButton *)sender {
    
    self.topFirstBtn.hidden = NO;
    self.topTwoBtn.hidden = NO;
    self.topThreeBtn.hidden = YES;
    self.topFourBtn.hidden = YES;
    self.topFiveBtn.hidden = YES;
    self.model.scores = @"2";
    [self.viewController.view endEditing:YES];

}


- (IBAction)bottomThreeBtnDidTap:(UIButton *)sender {
    
    self.topFirstBtn.hidden = NO;
    self.topTwoBtn.hidden = NO;
    self.topThreeBtn.hidden = NO;
    self.topFourBtn.hidden = YES;
    self.topFiveBtn.hidden = YES;
    self.model.scores = @"3";
    [self.viewController.view endEditing:YES];

}

- (IBAction)bottomFourBtnDidTap:(UIButton *)sender {
    
    self.topFirstBtn.hidden = NO;
    self.topTwoBtn.hidden = NO;
    self.topThreeBtn.hidden = NO;
    self.topFourBtn.hidden = NO;
    self.topFiveBtn.hidden = YES;
    self.model.scores = @"4";
    [self.viewController.view endEditing:YES];

}

- (IBAction)bottomFiveBtnDidTap:(UIButton *)sender {
    
    self.topFirstBtn.hidden = NO;
    self.topTwoBtn.hidden = NO;
    self.topThreeBtn.hidden = NO;
    self.topFourBtn.hidden = NO;
    self.topFiveBtn.hidden = NO;
    self.model.scores = @"5";
    [self.viewController.view endEditing:YES];

}

- (IBAction)TopFirstBtnDidTap:(UIButton *)sender {
    
    
    self.topFirstBtn.hidden = YES;
    self.topTwoBtn.hidden = YES;
    self.topThreeBtn.hidden = YES;
    self.topFourBtn.hidden = YES;
    self.topFiveBtn.hidden = YES;
    self.model.scores = @"0";
    [self.viewController.view endEditing:YES];

}

- (IBAction)TopTwoBtnDidTap:(UIButton *)sender {
    
    
    self.topFirstBtn.hidden = NO;
    self.topTwoBtn.hidden = YES;
    self.topThreeBtn.hidden = YES;
    self.topFourBtn.hidden = YES;
    self.topFiveBtn.hidden = YES;
    self.model.scores = @"1";
    [self.viewController.view endEditing:YES];

}


- (IBAction)TopThreeBtnDidTap:(UIButton *)sender {
    
    
    self.topFirstBtn.hidden = NO;
    self.topTwoBtn.hidden = NO;
    self.topThreeBtn.hidden = YES;
    self.topFourBtn.hidden = YES;
    self.topFiveBtn.hidden = YES;
    self.model.scores = @"2";
    [self.viewController.view endEditing:YES];

}

- (IBAction)TopFourBtnDidTap:(UIButton *)sender {
    
    self.topFirstBtn.hidden = NO;
    self.topTwoBtn.hidden = NO;
    self.topThreeBtn.hidden = NO;
    self.topFourBtn.hidden = YES;
    self.topFiveBtn.hidden = YES;
    self.model.scores = @"3";
    [self.viewController.view endEditing:YES];

    
}

- (IBAction)TopFiveBtnDidTap:(UIButton *)sender {
    
    self.topFirstBtn.hidden = NO;
    self.topTwoBtn.hidden = NO;
    self.topThreeBtn.hidden = NO;
    self.topFourBtn.hidden = NO;
    self.topFiveBtn.hidden = YES;
    self.model.scores = @"4";
    [self.viewController.view endEditing:YES];

    
}


@end
